lite-site: skip module init when Newspack Lite Site plugin is active#4720
Conversation
miguelpeixe
left a comment
There was a problem hiding this comment.
Thanks, @R1shabh-Gupta!
It's best to hook this under plugins_loaded to ensure the Lite Site plugin is loaded.
…nst standalone plugin
There was a problem hiding this comment.
Pull request overview
This PR prevents the built-in Lite Site module inside newspack-plugin from initializing when the standalone Newspack Lite Site plugin is active, avoiding collisions on shared identifiers (settings group/option name, menu slug, and rewrite rules).
Changes:
- Add an early
defined( 'NEWSPACK_LITE_SITE_PLUGIN_FILE' )guard insideLite_Site::init()to no-op when the standalone plugin is present. - Switch module bootstrapping from an immediate
Lite_Site::init();call to aplugins_loadedhook so the constant check reliably reflects other loaded plugins.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# [6.42.0-alpha.1](v6.41.0...v6.42.0-alpha.1) (2026-05-21) ### Bug Fixes * **donations:** add reset method for flagged products cache ([#4709](#4709)) ([56ec746](56ec746)) * **integrations:** normalize inbound option shape in configure view ([#4717](#4717)) ([262c968](262c968)) * **lite-site:** skip module init when Lite Site plugin is active ([#4720](#4720)) ([a17cf24](a17cf24)) * prevent recursion in lite-site primary color on block themes ([#4747](#4747)) ([1771dc0](1771dc0)) ### Features * **access-control:** add group subscription identifier to metadata ([#4697](#4697)) ([8d71495](8d71495)), closes [#8217](https://github.com/Automattic/newspack-plugin/issues/8217) * **alert-manager:** route alerts to Slack via newspack_log ([#4723](#4723)) ([6e68ab6](6e68ab6)) * **analytics:** auto-provision GA4 custom dimensions ([#4657](#4657)) ([e3373cf](e3373cf)) * **cli:** teams-for-memberships diagnostics command ([#4662](#4662)) ([df92456](df92456)) * **donations:** add option to flag any WooCommerce product as a donation ([#4635](#4635)) ([5860c8b](5860c8b)) * **group-subs:** polish invite-links UX in My Account ([#4719](#4719)) ([1b639c4](1b639c4)) * **group-subs:** shareable invite links ([#4704](#4704)) ([76706f5](76706f5))
|
🎉 This PR is included in version 6.42.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
* **donations:** add reset method for flagged products cache ([#4709](Automattic/newspack-plugin#4709)) ([013c383](Automattic/newspack-plugin@013c383)) * **integrations:** normalize inbound option shape in configure view ([#4717](Automattic/newspack-plugin#4717)) ([7a20a2e](Automattic/newspack-plugin@7a20a2e)) * **lite-site:** skip module init when Lite Site plugin is active ([#4720](Automattic/newspack-plugin#4720)) ([aba85e0](Automattic/newspack-plugin@aba85e0)) * prevent recursion in lite-site primary color on block themes ([#4747](Automattic/newspack-plugin#4747)) ([b771fa0](Automattic/newspack-plugin@b771fa0)) * **access-control:** add group subscription identifier to metadata ([#4697](Automattic/newspack-plugin#4697)) ([65b50d3](Automattic/newspack-plugin@65b50d3)), closes [#8217](https://github.com/Automattic/newspack-plugin/issues/8217) * **alert-manager:** route alerts to Slack via newspack_log ([#4723](Automattic/newspack-plugin#4723)) ([e56293d](Automattic/newspack-plugin@e56293d)) * **analytics:** auto-provision GA4 custom dimensions ([#4657](Automattic/newspack-plugin#4657)) ([1e4f56d](Automattic/newspack-plugin@1e4f56d)) * **cli:** teams-for-memberships diagnostics command ([#4662](Automattic/newspack-plugin#4662)) ([15da7ee](Automattic/newspack-plugin@15da7ee)) * **donations:** add option to flag any WooCommerce product as a donation ([#4635](Automattic/newspack-plugin#4635)) ([08dd002](Automattic/newspack-plugin@08dd002)) * **group-subs:** polish invite-links UX in My Account ([#4719](Automattic/newspack-plugin#4719)) ([6ced5ea](Automattic/newspack-plugin@6ced5ea)) * **group-subs:** shareable invite links ([#4704](Automattic/newspack-plugin#4704)) ([05a8d50](Automattic/newspack-plugin@05a8d50)) (cherry picked from commit 2d2a341e069b52acbbe3d4679b85433170da16e4)
# [6.43.0-alpha.1](v6.42.0...v6.43.0-alpha.1) (2026-06-01) ### Bug Fixes * **donations:** add reset method for flagged products cache ([#4709](#4709)) ([56ec746](56ec746)) * **integrations:** normalize inbound option shape in configure view ([#4717](#4717)) ([262c968](262c968)) * **lite-site:** skip module init when Lite Site plugin is active ([#4720](#4720)) ([a17cf24](a17cf24)) * prevent recursion in lite-site primary color on block themes ([#4747](#4747)) ([1771dc0](1771dc0)) ### Features * **access-control:** add group subscription identifier to metadata ([#4697](#4697)) ([8d71495](8d71495)), closes [#8217](https://github.com/Automattic/newspack-plugin/issues/8217) * **alert-manager:** route alerts to Slack via newspack_log ([#4723](#4723)) ([6e68ab6](6e68ab6)) * **analytics:** auto-provision GA4 custom dimensions ([#4657](#4657)) ([e3373cf](e3373cf)) * **cli:** teams-for-memberships diagnostics command ([#4662](#4662)) ([df92456](df92456)) * **donations:** add option to flag any WooCommerce product as a donation ([#4635](#4635)) ([5860c8b](5860c8b)) * **group-subs:** polish invite-links UX in My Account ([#4719](#4719)) ([1b639c4](1b639c4)) * **group-subs:** shareable invite links ([#4704](#4704)) ([76706f5](76706f5))
|
🎉 This PR is included in version 6.43.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
When the Newspack Lite Site plugin (code here) is active alongside
newspack-plugin, both register identical WordPress identifiers and the same settings group (newspack_lite_site), option name (newspack_lite_site_settings), admin menu slug (newspack-lite-site), and rewrite rules. This causes:sanitize_option_newspack_lite_site_settings.The standalone plugin defines
NEWSPACK_LITE_SITE_PLUGIN_FILEin its main file at load time. GuardingLite_Site::init()with a check for that constant prevents the built-in module from initializing at all when the standalone plugin is active, eliminating all four collision points.All Submissions:
Changes proposed in this Pull Request:
Wrap
Lite_Site::init()inincludes/lite-site/class-lite-site.phpwith adefined( 'NEWSPACK_LITE_SITE_PLUGIN_FILE' )guard so the built-in lite-site module is a no-op when the Newspack Lite Site plugin is active.How to test the changes in this Pull Request:
newspack-pluginand the Newspack Lite Site plugin.NEWSPACK_LITE_SITE_PLUGIN_FILEis undefined).Other information: